<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Bundler::Persistent::Net::HTTP::Persistent - bundler: Ruby Standard Library Documentation</title>


<script src="../../../../js/navigation.js" defer></script>
<script src="../../../../js/search.js" defer></script>
<script src="../../../../js/search_index.js" defer></script>
<script src="../../../../js/searcher.js" defer></script>
<script src="../../../../js/darkfish.js" defer></script>

<script src="../../../../js/jquery-3.2.0.min.js"></script>

<script src="../../../../js/vue.min.js"></script>
<script src="../../../../js/js.cookie.min.js"></script>

<link href="../../../../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../../../../css/rdoc.css" rel="stylesheet">
<link href="../../../../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../../../../";
  var index_rel_prefix = "../../../../";
  var darkModeCsseHref = "../../../../css/rdoc-dm.css"
  var defaultModeCssHref = "../../../../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../../../../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../../../../table_of_contents.html#pages">Pages</a>
    <a href="../../../../table_of_contents.html#classes">Classes</a>
    <a href="../../../../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    
<div class="nav-section">
  <h3>Table of Contents</h3>

  <ul class="link-list" role="directory">
    <li><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-TLS-2FSSL">TLS/SSL</a>
    <li><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Proxies">Proxies</a>
    <li><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Headers">Headers</a>
    <li><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Tuning">Tuning</a>
    <li><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Segregation">Segregation</a>
    <li><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Idle+Timeout">Idle Timeout</a>
    <li><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Read+Timeout">Read Timeout</a>
    <li><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Max+Requests">Max Requests</a>
    <li><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Open+Timeout">Open Timeout</a>
    <li><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Socket+Options">Socket Options</a>
    <li><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Connection+Termination">Connection Termination</a>
  </ul>
</div>


    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="../../../../Object.html">Object</a>
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-detect_idle_timeout">::detect_idle_timeout</a>
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-ca_file-3D">#ca_file=</a>
    <li ><a href="#method-i-ca_path-3D">#ca_path=</a>
    <li ><a href="#method-i-cert-3D">#cert=</a>
    <li ><a href="#method-i-cert_store-3D">#cert_store=</a>
    <li ><a href="#method-i-certificate-3D">#certificate=</a>
    <li ><a href="#method-i-ciphers-3D">#ciphers=</a>
    <li ><a href="#method-i-connection_for">#connection_for</a>
    <li ><a href="#method-i-escape">#escape</a>
    <li ><a href="#method-i-expired-3F">#expired?</a>
    <li ><a href="#method-i-finish">#finish</a>
    <li ><a href="#method-i-http_version">#http_version</a>
    <li ><a href="#method-i-key-3D">#key=</a>
    <li ><a href="#method-i-max_retries-3D">#max_retries=</a>
    <li ><a href="#method-i-max_version-3D">#max_version=</a>
    <li ><a href="#method-i-min_version-3D">#min_version=</a>
    <li ><a href="#method-i-normalize_uri">#normalize_uri</a>
    <li ><a href="#method-i-private_key-3D">#private_key=</a>
    <li ><a href="#method-i-proxy-3D">#proxy=</a>
    <li ><a href="#method-i-proxy_bypass-3F">#proxy_bypass?</a>
    <li ><a href="#method-i-proxy_from_env">#proxy_from_env</a>
    <li ><a href="#method-i-reconnect">#reconnect</a>
    <li ><a href="#method-i-reconnect_ssl">#reconnect_ssl</a>
    <li ><a href="#method-i-request">#request</a>
    <li ><a href="#method-i-reset">#reset</a>
    <li ><a href="#method-i-shutdown">#shutdown</a>
    <li ><a href="#method-i-ssl">#ssl</a>
    <li ><a href="#method-i-ssl_timeout-3D">#ssl_timeout=</a>
    <li ><a href="#method-i-ssl_version-3D">#ssl_version=</a>
    <li ><a href="#method-i-start">#start</a>
    <li ><a href="#method-i-unescape">#unescape</a>
    <li ><a href="#method-i-verify_callback-3D">#verify_callback=</a>
    <li ><a href="#method-i-verify_depth-3D">#verify_depth=</a>
    <li ><a href="#method-i-verify_mode-3D">#verify_mode=</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Bundler::Persistent::Net::HTTP::Persistent">
    <h1 id="class-Bundler::Persistent::Net::HTTP::Persistent" class="class">
      class Bundler::Persistent::Net::HTTP::Persistent
    </h1>

    <section class="description">
    
<p><a href="Persistent.html"><code>Persistent</code></a> connections for Net::HTTP</p>

<p><a href="Persistent.html"><code>Bundler::Persistent::Net::HTTP::Persistent</code></a> maintains persistent connections across all the servers you wish to talk to.  For each host:port you communicate with a single persistent connection is created.</p>

<p>Connections will be shared across threads through a connection pool to increase reuse of connections.</p>

<p>You can shut down any remaining HTTP connections when done by calling <a href="Persistent.html#method-i-shutdown"><code>shutdown</code></a>.</p>

<p>Example:</p>

<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;bundler/vendor/net-http-persistent/lib/net/http/persistent&#39;</span>

<span class="ruby-identifier">uri</span> = <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span> <span class="ruby-string">&#39;http://example.com/awesome/web/service&#39;</span>

<span class="ruby-identifier">http</span> = <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">Persistent</span><span class="ruby-operator">::</span><span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Persistent</span>.<span class="ruby-identifier">new</span>

<span class="ruby-comment"># perform a GET</span>
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span> <span class="ruby-identifier">uri</span>

<span class="ruby-comment"># or</span>

<span class="ruby-identifier">get</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Get</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">request_uri</span>
<span class="ruby-identifier">response</span> = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span> <span class="ruby-identifier">get</span>

<span class="ruby-comment"># create a POST</span>
<span class="ruby-identifier">post_uri</span> = <span class="ruby-identifier">uri</span> <span class="ruby-operator">+</span> <span class="ruby-string">&#39;create&#39;</span>
<span class="ruby-identifier">post</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Post</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">post_uri</span>.<span class="ruby-identifier">path</span>
<span class="ruby-identifier">post</span>.<span class="ruby-identifier">set_form_data</span> <span class="ruby-string">&#39;some&#39;</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-string">&#39;cool data&#39;</span>

<span class="ruby-comment"># perform the POST, the Bundler::URI is always required</span>
<span class="ruby-identifier">response</span> <span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span> <span class="ruby-identifier">post_uri</span>, <span class="ruby-identifier">post</span>
</pre>

<p>Note that for GET, HEAD and other requests that do not have a body you want to use Bundler::URI#request_uri not Bundler::URI#path.  The request_uri contains the query params which are sent in the body for other requests.</p>

<h2 id="class-Bundler::Persistent::Net::HTTP::Persistent-label-TLS-2FSSL">TLS/SSL<span><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-TLS-2FSSL">&para;</a> <a href="#top">&uarr;</a></span></h2>

<p>TLS connections are automatically created depending upon the scheme of the <a href="../../../URI.html"><code>Bundler::URI</code></a>.  TLS connections are automatically verified against the default certificate store for your computer.  You can override this by changing <a href="Persistent.html#attribute-i-verify_mode"><code>verify_mode</code></a> or by specifying an alternate cert_store.</p>

<p>Here are the TLS settings, see the individual methods for documentation:</p>
<dl class="rdoc-list note-list"><dt><a href="Persistent.html#attribute-i-certificate"><code>certificate</code></a>        
<dd>
<p>This client’s certificate</p>
</dd><dt><a href="Persistent.html#attribute-i-ca_file"><code>ca_file</code></a>            
<dd>
<p>The certificate-authorities</p>
</dd><dt><a href="Persistent.html#attribute-i-ca_path"><code>ca_path</code></a>            
<dd>
<p>Directory with certificate-authorities</p>
</dd><dt><a href="Persistent.html#attribute-i-cert_store"><code>cert_store</code></a>         
<dd>
<p>An SSL certificate store</p>
</dd><dt><a href="Persistent.html#attribute-i-ciphers"><code>ciphers</code></a>            
<dd>
<p>List of SSl ciphers allowed</p>
</dd><dt><a href="Persistent.html#attribute-i-private_key"><code>private_key</code></a>        
<dd>
<p>The client’s SSL private key</p>
</dd><dt><a href="Persistent.html#attribute-i-reuse_ssl_sessions"><code>reuse_ssl_sessions</code></a> 
<dd>
<p>Reuse a previously opened SSL session for a new connection</p>
</dd><dt><a href="Persistent.html#attribute-i-ssl_timeout"><code>ssl_timeout</code></a>        
<dd>
<p>Session lifetime</p>
</dd><dt><a href="Persistent.html#attribute-i-ssl_version"><code>ssl_version</code></a>        
<dd>
<p>Which specific SSL version to use</p>
</dd><dt><a href="Persistent.html#attribute-i-verify_callback"><code>verify_callback</code></a>    
<dd>
<p>For server certificate verification</p>
</dd><dt><a href="Persistent.html#attribute-i-verify_depth"><code>verify_depth</code></a>       
<dd>
<p>Depth of certificate verification</p>
</dd><dt><a href="Persistent.html#attribute-i-verify_mode"><code>verify_mode</code></a>        
<dd>
<p>How connections should be verified</p>
</dd></dl>

<h2 id="class-Bundler::Persistent::Net::HTTP::Persistent-label-Proxies">Proxies<span><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Proxies">&para;</a> <a href="#top">&uarr;</a></span></h2>

<p>A proxy can be set through <a href="Persistent.html#method-i-proxy-3D"><code>proxy=</code></a> or at initialization time by providing a second argument to <a href="Persistent.html#method-c-new"><code>::new</code></a>.  The proxy may be the <a href="../../../URI.html"><code>Bundler::URI</code></a> of the proxy server or <code>:ENV</code> which will consult environment variables.</p>

<p>See <a href="Persistent.html#method-i-proxy-3D"><code>proxy=</code></a> and <a href="Persistent.html#method-i-proxy_from_env"><code>proxy_from_env</code></a> for details.</p>

<h2 id="class-Bundler::Persistent::Net::HTTP::Persistent-label-Headers">Headers<span><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Headers">&para;</a> <a href="#top">&uarr;</a></span></h2>

<p>Headers may be specified for use in every request.  <a href="Persistent.html#attribute-i-headers"><code>headers</code></a> are appended to any headers on the request.  <a href="Persistent.html#attribute-i-override_headers"><code>override_headers</code></a> replace existing headers on the request.</p>

<p>The difference between the two can be seen in setting the User-Agent.  Using <code>http.headers[&#39;User-Agent&#39;] = &#39;MyUserAgent&#39;</code> will send “Ruby, MyUserAgent” while <code>http.override_headers[&#39;User-Agent&#39;] = &#39;MyUserAgent&#39;</code> will send “MyUserAgent”.</p>

<h2 id="class-Bundler::Persistent::Net::HTTP::Persistent-label-Tuning">Tuning<span><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Tuning">&para;</a> <a href="#top">&uarr;</a></span></h2>

<h3 id="class-Bundler::Persistent::Net::HTTP::Persistent-label-Segregation">Segregation<span><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Segregation">&para;</a> <a href="#top">&uarr;</a></span></h3>

<p>Each <a href="Persistent.html"><code>Bundler::Persistent::Net::HTTP::Persistent</code></a> instance has its own pool of connections.  There is no sharing with other instances (as was true in earlier versions).</p>

<h3 id="class-Bundler::Persistent::Net::HTTP::Persistent-label-Idle+Timeout">Idle Timeout<span><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Idle+Timeout">&para;</a> <a href="#top">&uarr;</a></span></h3>

<p>If a connection hasn’t been used for this number of seconds it will automatically be reset upon the next use to avoid attempting to send to a closed connection.  The default value is 5 seconds. nil means no timeout. Set through <a href="Persistent.html#attribute-i-idle_timeout"><code>idle_timeout</code></a>.</p>

<p>Reducing this value may help avoid the “too many connection resets” error when sending non-idempotent requests while increasing this value will cause fewer round-trips.</p>

<h3 id="class-Bundler::Persistent::Net::HTTP::Persistent-label-Read+Timeout">Read Timeout<span><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Read+Timeout">&para;</a> <a href="#top">&uarr;</a></span></h3>

<p>The amount of time allowed between reading two chunks from the socket.  Set through <a href="Persistent.html#attribute-i-read_timeout"><code>read_timeout</code></a></p>

<h3 id="class-Bundler::Persistent::Net::HTTP::Persistent-label-Max+Requests">Max Requests<span><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Max+Requests">&para;</a> <a href="#top">&uarr;</a></span></h3>

<p>The number of requests that should be made before opening a new connection. Typically many keep-alive capable servers tune this to 100 or less, so the 101st request will fail with ECONNRESET. If unset (default), this value has no effect, if set, connections will be reset on the request after max_requests.</p>

<h3 id="class-Bundler::Persistent::Net::HTTP::Persistent-label-Open+Timeout">Open Timeout<span><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Open+Timeout">&para;</a> <a href="#top">&uarr;</a></span></h3>

<p>The amount of time to wait for a connection to be opened.  Set through <a href="Persistent.html#attribute-i-open_timeout"><code>open_timeout</code></a>.</p>

<h3 id="class-Bundler::Persistent::Net::HTTP::Persistent-label-Socket+Options">Socket Options<span><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Socket+Options">&para;</a> <a href="#top">&uarr;</a></span></h3>

<p>Socket options may be set on newly-created connections.  See <a href="Persistent.html#attribute-i-socket_options"><code>socket_options</code></a> for details.</p>

<h3 id="class-Bundler::Persistent::Net::HTTP::Persistent-label-Connection+Termination">Connection Termination<span><a href="#class-Bundler::Persistent::Net::HTTP::Persistent-label-Connection+Termination">&para;</a> <a href="#top">&uarr;</a></span></h3>

<p>If you are done using the <a href="Persistent.html"><code>Bundler::Persistent::Net::HTTP::Persistent</code></a> instance you may shut down all the connections in the current thread with <a href="Persistent.html#method-i-shutdown"><code>shutdown</code></a>.  This is not recommended for normal use, it should only be used when it will be several minutes before you make another HTTP request.</p>

<p>If you are using multiple threads, call <a href="Persistent.html#method-i-shutdown"><code>shutdown</code></a> in each thread when the thread is done making requests.  If you don’t call shutdown, that’s OK. Ruby will automatically garbage collect and shutdown your HTTP connections when the thread terminates.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="DEFAULT_POOL_SIZE">DEFAULT_POOL_SIZE
          <dd>
          <dt id="VERSION">VERSION
          <dd><p>The version of <a href="Persistent.html"><code>Bundler::Persistent::Net::HTTP::Persistent</code></a> you are using</p>
        </dl>
        </section>

        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-ca_file" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">ca_file</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>An SSL certificate authority.  Setting this will set <a href="Persistent.html#attribute-i-verify_mode"><code>verify_mode</code></a> to VERIFY_PEER.</p>
              </div>
            </div>
          <div id="attribute-i-ca_path" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">ca_path</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>A directory of SSL certificates to be used as certificate authorities. Setting this will set <a href="Persistent.html#attribute-i-verify_mode"><code>verify_mode</code></a> to VERIFY_PEER.</p>
              </div>
            </div>
          <div id="attribute-i-cert" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">cert</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>This client’s OpenSSL::X509::Certificate</p>
              </div>
            </div>
          <div id="attribute-i-cert_store" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">cert_store</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>An SSL certificate store.  Setting this will override the default certificate store.  See <a href="Persistent.html#attribute-i-verify_mode"><code>verify_mode</code></a> for more information.</p>
              </div>
            </div>
          <div id="attribute-i-certificate" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">certificate</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>This client’s OpenSSL::X509::Certificate</p>
              </div>
            </div>
          <div id="attribute-i-ciphers" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">ciphers</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>The ciphers allowed for SSL connections</p>
              </div>
            </div>
          <div id="attribute-i-debug_output" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">debug_output</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Sends <a href="Persistent.html#attribute-i-debug_output"><code>debug_output</code></a> to this IO via Net::HTTP#set_debug_output.</p>

<p>Never use this method in production code, it causes a serious security hole.</p>
              </div>
            </div>
          <div id="attribute-i-headers" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">headers</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Headers that are added to every request using Net::HTTP#add_field</p>
              </div>
            </div>
          <div id="attribute-i-http_versions" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">http_versions</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Maps host:port to an HTTP version.  This allows us to enable version specific features.</p>
              </div>
            </div>
          <div id="attribute-i-idle_timeout" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">idle_timeout</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Maximum time an unused connection can remain idle before being automatically closed.</p>
              </div>
            </div>
          <div id="attribute-i-keep_alive" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">keep_alive</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>The value sent in the Keep-Alive header.  Defaults to 30.  Not needed for HTTP/1.1 servers.</p>

<p>This may not work correctly for HTTP/1.0 servers</p>

<p>This method may be removed in a future version as RFC 2616 does not require this header.</p>
              </div>
            </div>
          <div id="attribute-i-key" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">key</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>This client’s SSL private key</p>
              </div>
            </div>
          <div id="attribute-i-max_requests" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">max_requests</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Maximum number of requests on a connection before it is considered expired and automatically closed.</p>
              </div>
            </div>
          <div id="attribute-i-max_retries" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">max_retries</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Number of retries to perform if a request fails.</p>

<p>See also <a href="Persistent.html#method-i-max_retries-3D"><code>max_retries=</code></a>, Net::HTTP#max_retries=.</p>
              </div>
            </div>
          <div id="attribute-i-max_version" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">max_version</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Maximum SSL version to use, e.g. :TLS1_2</p>

<p>By default, the version will be negotiated automatically between client and server.  Ruby 2.5 and newer only.</p>
              </div>
            </div>
          <div id="attribute-i-min_version" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">min_version</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Minimum SSL version to use, e.g. :TLS1_1</p>

<p>By default, the version will be negotiated automatically between client and server.  Ruby 2.5 and newer only.</p>
              </div>
            </div>
          <div id="attribute-i-name" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">name</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>The name for this collection of persistent connections.</p>
              </div>
            </div>
          <div id="attribute-i-no_proxy" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">no_proxy</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>List of host suffixes which will not be proxied</p>
              </div>
            </div>
          <div id="attribute-i-open_timeout" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">open_timeout</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Seconds to wait until a connection is opened.  See Net::HTTP#open_timeout</p>
              </div>
            </div>
          <div id="attribute-i-override_headers" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">override_headers</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Headers that are added to every request using Net::HTTP#[]=</p>
              </div>
            </div>
          <div id="attribute-i-private_key" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">private_key</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>This client’s SSL private key</p>
              </div>
            </div>
          <div id="attribute-i-proxy_uri" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">proxy_uri</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>The URL through which requests will be proxied</p>
              </div>
            </div>
          <div id="attribute-i-read_timeout" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">read_timeout</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Seconds to wait until reading one block.  See Net::HTTP#read_timeout</p>
              </div>
            </div>
          <div id="attribute-i-reuse_ssl_sessions" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">reuse_ssl_sessions</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>By default SSL sessions are reused to avoid extra SSL handshakes.  Set this to false if you have problems communicating with an HTTPS server like:</p>

<pre>SSL_connect [...] read finished A: unexpected message (OpenSSL::SSL::SSLError)</pre>
              </div>
            </div>
          <div id="attribute-i-socket_options" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">socket_options</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>An array of options for Socket#setsockopt.</p>

<p>By default the TCP_NODELAY option is set on sockets.</p>

<p>To set additional options append them to this array:</p>

<pre class="ruby"><span class="ruby-identifier">http</span>.<span class="ruby-identifier">socket_options</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-constant">Socket</span><span class="ruby-operator">::</span><span class="ruby-constant">SOL_SOCKET</span>, <span class="ruby-constant">Socket</span><span class="ruby-operator">::</span><span class="ruby-constant">SO_KEEPALIVE</span>, <span class="ruby-value">1</span>]
</pre>
              </div>
            </div>
          <div id="attribute-i-ssl_timeout" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">ssl_timeout</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>SSL session lifetime</p>
              </div>
            </div>
          <div id="attribute-i-ssl_version" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">ssl_version</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>SSL version to use.</p>

<p>By default, the version will be negotiated automatically between client and server.  Ruby 1.9 and newer only. Deprecated since Ruby 2.5.</p>
              </div>
            </div>
          <div id="attribute-i-verify_callback" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">verify_callback</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>SSL verification callback.  Used when <a href="Persistent.html#attribute-i-ca_file"><code>ca_file</code></a> or <a href="Persistent.html#attribute-i-ca_path"><code>ca_path</code></a> is set.</p>
              </div>
            </div>
          <div id="attribute-i-verify_depth" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">verify_depth</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Sets the depth of SSL certificate verification</p>
              </div>
            </div>
          <div id="attribute-i-verify_mode" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">verify_mode</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>HTTPS verify mode.  Defaults to OpenSSL::SSL::VERIFY_PEER which verifies the server certificate.</p>

<p>If no <a href="Persistent.html#attribute-i-ca_file"><code>ca_file</code></a>, <a href="Persistent.html#attribute-i-ca_path"><code>ca_path</code></a> or <a href="Persistent.html#attribute-i-cert_store"><code>cert_store</code></a> is set the default system certificate store is used.</p>

<p>You can use <code>verify_mode</code> to override any default values.</p>
              </div>
            </div>
          <div id="attribute-i-write_timeout" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">write_timeout</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Seconds to wait until writing one block.  See Net::HTTP#write_timeout</p>
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-detect_idle_timeout" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">detect_idle_timeout</span><span
                                class="method-args">(uri, max = 10)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Use this method to detect the idle timeout of the host at <code>uri</code>.  The value returned can be used to configure <a href="Persistent.html#attribute-i-idle_timeout"><code>idle_timeout</code></a>.  <code>max</code> controls the maximum idle timeout to detect.</p>

<p>After</p>

<p>Idle timeout detection is performed by creating a connection then performing a HEAD request in a loop until the connection terminates waiting one additional second per loop.</p>

<p>NOTE:  This may not work on ruby &gt; 1.9.</p>

                              <div class="method-source-code" id="detect_idle_timeout-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 199</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">detect_idle_timeout</span> <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">max</span> = <span class="ruby-value">10</span>
  <span class="ruby-identifier">uri</span> = <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span> <span class="ruby-identifier">uri</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">Generic</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">uri</span>
  <span class="ruby-identifier">uri</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&#39;/&#39;</span>

  <span class="ruby-identifier">req</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Head</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">request_uri</span>

  <span class="ruby-identifier">http</span> = <span class="ruby-identifier">new</span> <span class="ruby-string">&#39;net-http-persistent detect_idle_timeout&#39;</span>

  <span class="ruby-identifier">http</span>.<span class="ruby-identifier">connection_for</span> <span class="ruby-identifier">uri</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">connection</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">sleep_time</span> = <span class="ruby-value">0</span>

    <span class="ruby-identifier">http</span> = <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">http</span>

    <span class="ruby-identifier">loop</span> <span class="ruby-keyword">do</span>
      <span class="ruby-identifier">response</span> = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span> <span class="ruby-identifier">req</span>

      <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;HEAD #{uri} =&gt; #{response.code}&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">$DEBUG</span>

      <span class="ruby-keyword">unless</span> <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTPOK</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">response</span> <span class="ruby-keyword">then</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-node">&quot;bad response code #{response.code} detecting idle timeout&quot;</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">sleep_time</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">max</span>

      <span class="ruby-identifier">sleep_time</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>

      <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;sleeping #{sleep_time}&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">$DEBUG</span>
      <span class="ruby-identifier">sleep</span> <span class="ruby-identifier">sleep_time</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">rescue</span>
  <span class="ruby-comment"># ignore StandardErrors, we&#39;ve probably found the idle timeout.</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">sleep_time</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">$!</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(name: nil, proxy: nil, pool_size: DEFAULT_POOL_SIZE)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Creates a new <a href="Persistent.html"><code>Bundler::Persistent::Net::HTTP::Persistent</code></a>.</p>

<p>Set a <code>name</code> for fun.  Your library name should be good enough, but this otherwise has no purpose.</p>

<p><code>proxy</code> may be set to a <a href="../../../URI/HTTP.html"><code>Bundler::URI::HTTP</code></a> or :ENV to pick up proxy options from the environment.  See <a href="Persistent.html#method-i-proxy_from_env"><code>proxy_from_env</code></a> for details.</p>

<p>In order to use a <a href="../../../URI.html"><code>Bundler::URI</code></a> for the proxy you may need to do some extra work beyond <a href="../../../URI.html"><code>Bundler::URI</code></a> parsing if the proxy requires a password:</p>

<pre class="ruby"><span class="ruby-identifier">proxy</span> = <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span> <span class="ruby-string">&#39;http://proxy.example&#39;</span>
<span class="ruby-identifier">proxy</span>.<span class="ruby-identifier">user</span>     = <span class="ruby-string">&#39;AzureDiamond&#39;</span>
<span class="ruby-identifier">proxy</span>.<span class="ruby-identifier">password</span> = <span class="ruby-string">&#39;hunter2&#39;</span>
</pre>

<p>Set <code>pool_size</code> to limit the maximum number of connections allowed. Defaults to 1/4 the number of allowed file handles or 256 if your OS does not support a limit on allowed file handles.  You can have no more than this many threads with active HTTP transactions.</p>

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 473</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span> <span class="ruby-value">name:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">proxy:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">pool_size:</span> <span class="ruby-constant">DEFAULT_POOL_SIZE</span>
  <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>

  <span class="ruby-ivar">@debug_output</span>     = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@proxy_uri</span>        = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@no_proxy</span>         = []
  <span class="ruby-ivar">@headers</span>          = {}
  <span class="ruby-ivar">@override_headers</span> = {}
  <span class="ruby-ivar">@http_versions</span>    = {}
  <span class="ruby-ivar">@keep_alive</span>       = <span class="ruby-value">30</span>
  <span class="ruby-ivar">@open_timeout</span>     = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@read_timeout</span>     = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@write_timeout</span>    = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@idle_timeout</span>     = <span class="ruby-value">5</span>
  <span class="ruby-ivar">@max_requests</span>     = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@max_retries</span>      = <span class="ruby-value">1</span>
  <span class="ruby-ivar">@socket_options</span>   = []
  <span class="ruby-ivar">@ssl_generation</span>   = <span class="ruby-value">0</span> <span class="ruby-comment"># incremented when SSL session variables change</span>

  <span class="ruby-ivar">@socket_options</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-constant">Socket</span><span class="ruby-operator">::</span><span class="ruby-constant">IPPROTO_TCP</span>, <span class="ruby-constant">Socket</span><span class="ruby-operator">::</span><span class="ruby-constant">TCP_NODELAY</span>, <span class="ruby-value">1</span>] <span class="ruby-keyword">if</span>
    <span class="ruby-constant">Socket</span>.<span class="ruby-identifier">const_defined?</span> <span class="ruby-value">:TCP_NODELAY</span>

  <span class="ruby-ivar">@pool</span> = <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">Persistent</span><span class="ruby-operator">::</span><span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Persistent</span><span class="ruby-operator">::</span><span class="ruby-constant">Pool</span>.<span class="ruby-identifier">new</span> <span class="ruby-value">size:</span> <span class="ruby-identifier">pool_size</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">http_args</span><span class="ruby-operator">|</span>
    <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">Persistent</span><span class="ruby-operator">::</span><span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Persistent</span><span class="ruby-operator">::</span><span class="ruby-constant">Connection</span>.<span class="ruby-identifier">new</span> <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>, <span class="ruby-identifier">http_args</span>, <span class="ruby-ivar">@ssl_generation</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@certificate</span>        = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@ca_file</span>            = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@ca_path</span>            = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@ciphers</span>            = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@private_key</span>        = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@ssl_timeout</span>        = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@ssl_version</span>        = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@min_version</span>        = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@max_version</span>        = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@verify_callback</span>    = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@verify_depth</span>       = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@verify_mode</span>        = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@cert_store</span>         = <span class="ruby-keyword">nil</span>

  <span class="ruby-ivar">@generation</span>         = <span class="ruby-value">0</span> <span class="ruby-comment"># incremented when proxy Bundler::URI changes</span>

  <span class="ruby-keyword">if</span> <span class="ruby-constant">HAVE_OPENSSL</span> <span class="ruby-keyword">then</span>
    <span class="ruby-ivar">@verify_mode</span>        = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSL</span><span class="ruby-operator">::</span><span class="ruby-constant">VERIFY_PEER</span>
    <span class="ruby-ivar">@reuse_ssl_sessions</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSL</span>.<span class="ruby-identifier">const_defined?</span> <span class="ruby-value">:Session</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">proxy</span> = <span class="ruby-identifier">proxy</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">proxy</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-ca_file-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ca_file=</span><span
                                class="method-args">(file)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Sets the SSL certificate authority file.</p>

                              <div class="method-source-code" id="ca_file-3D-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 538</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ca_file=</span> <span class="ruby-identifier">file</span>
  <span class="ruby-ivar">@ca_file</span> = <span class="ruby-identifier">file</span>

  <span class="ruby-identifier">reconnect_ssl</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ca_path-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ca_path=</span><span
                                class="method-args">(path)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Sets the SSL certificate authority path.</p>

                              <div class="method-source-code" id="ca_path-3D-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 547</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ca_path=</span> <span class="ruby-identifier">path</span>
  <span class="ruby-ivar">@ca_path</span> = <span class="ruby-identifier">path</span>

  <span class="ruby-identifier">reconnect_ssl</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cert-3D" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">cert=</span><span
                                class="method-args">(certificate)</span>
                            </div>

                            <div class="method-description">
                              <p>For Net::HTTP parity</p>

                            </div>


                            <div class="aliases">
                              Alias for: <a href="Persistent.html#method-i-certificate-3D">certificate=</a>
                            </div>
                          </div>

                  <div id="method-i-cert_store-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cert_store=</span><span
                                class="method-args">(store)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Overrides the default SSL certificate store used for verifying connections.</p>

                              <div class="method-source-code" id="cert_store-3D-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 557</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cert_store=</span> <span class="ruby-identifier">store</span>
  <span class="ruby-ivar">@cert_store</span> = <span class="ruby-identifier">store</span>

  <span class="ruby-identifier">reconnect_ssl</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-certificate-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">certificate=</span><span
                                class="method-args">(certificate)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Sets this client’s OpenSSL::X509::Certificate</p>

                              <div class="method-source-code" id="certificate-3D-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 526</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">certificate=</span> <span class="ruby-identifier">certificate</span>
  <span class="ruby-ivar">@certificate</span> = <span class="ruby-identifier">certificate</span>

  <span class="ruby-identifier">reconnect_ssl</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="Persistent.html#method-i-cert-3D">cert=</a>
                            </div>

                          </div>

                  <div id="method-i-ciphers-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ciphers=</span><span
                                class="method-args">(ciphers)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>The ciphers allowed for SSL connections</p>

                              <div class="method-source-code" id="ciphers-3D-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 566</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ciphers=</span> <span class="ruby-identifier">ciphers</span>
  <span class="ruby-ivar">@ciphers</span> = <span class="ruby-identifier">ciphers</span>

  <span class="ruby-identifier">reconnect_ssl</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-connection_for" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">connection_for</span><span
                                class="method-args">(uri) { |connection| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Creates a new connection for <code>uri</code></p>

                              <div class="method-source-code" id="connection_for-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 575</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">connection_for</span> <span class="ruby-identifier">uri</span>
  <span class="ruby-identifier">use_ssl</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;https&#39;</span>

  <span class="ruby-identifier">net_http_args</span> = [<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">hostname</span>, <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">port</span>]

  <span class="ruby-comment"># I&#39;m unsure if uri.host or uri.hostname should be checked against</span>
  <span class="ruby-comment"># the proxy bypass list.</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@proxy_uri</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">proxy_bypass?</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">host</span>, <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">port</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">net_http_args</span>.<span class="ruby-identifier">concat</span> <span class="ruby-ivar">@proxy_args</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">net_http_args</span>.<span class="ruby-identifier">concat</span> [<span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>]
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">connection</span> = <span class="ruby-ivar">@pool</span>.<span class="ruby-identifier">checkout</span> <span class="ruby-identifier">net_http_args</span>

  <span class="ruby-identifier">http</span> = <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">http</span>

  <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">ressl</span> <span class="ruby-ivar">@ssl_generation</span> <span class="ruby-keyword">if</span>
    <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">ssl_generation</span> <span class="ruby-operator">!=</span> <span class="ruby-ivar">@ssl_generation</span>

  <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">http</span>.<span class="ruby-identifier">started?</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">ssl</span>   <span class="ruby-identifier">http</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">use_ssl</span>
    <span class="ruby-identifier">start</span> <span class="ruby-identifier">http</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">expired?</span> <span class="ruby-identifier">connection</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">reset</span> <span class="ruby-identifier">connection</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">http</span>.<span class="ruby-identifier">keep_alive_timeout</span> = <span class="ruby-ivar">@idle_timeout</span>  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@idle_timeout</span>
  <span class="ruby-identifier">http</span>.<span class="ruby-identifier">max_retries</span>        = <span class="ruby-ivar">@max_retries</span>   <span class="ruby-keyword">if</span> <span class="ruby-identifier">http</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:max_retries=</span>)
  <span class="ruby-identifier">http</span>.<span class="ruby-identifier">read_timeout</span>       = <span class="ruby-ivar">@read_timeout</span>  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@read_timeout</span>
  <span class="ruby-identifier">http</span>.<span class="ruby-identifier">write_timeout</span>      = <span class="ruby-ivar">@write_timeout</span> <span class="ruby-keyword">if</span>
    <span class="ruby-ivar">@write_timeout</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">http</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:write_timeout=</span>)

  <span class="ruby-keyword">return</span> <span class="ruby-keyword">yield</span> <span class="ruby-identifier">connection</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNREFUSED</span>
  <span class="ruby-identifier">address</span> = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">proxy_address</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">http</span>.<span class="ruby-identifier">address</span>
  <span class="ruby-identifier">port</span>    = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">proxy_port</span>    <span class="ruby-operator">||</span> <span class="ruby-identifier">http</span>.<span class="ruby-identifier">port</span>

  <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-node">&quot;connection refused: #{address}:#{port}&quot;</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EHOSTDOWN</span>
  <span class="ruby-identifier">address</span> = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">proxy_address</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">http</span>.<span class="ruby-identifier">address</span>
  <span class="ruby-identifier">port</span>    = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">proxy_port</span>    <span class="ruby-operator">||</span> <span class="ruby-identifier">http</span>.<span class="ruby-identifier">port</span>

  <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-node">&quot;host down: #{address}:#{port}&quot;</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-ivar">@pool</span>.<span class="ruby-identifier">checkin</span> <span class="ruby-identifier">net_http_args</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-escape" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">escape</span><span
                                class="method-args">(str)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>CGI::escape wrapper</p>

                              <div class="method-source-code" id="escape-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 626</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">escape</span> <span class="ruby-identifier">str</span>
  <span class="ruby-constant">CGI</span>.<span class="ruby-identifier">escape</span> <span class="ruby-identifier">str</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">str</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-expired-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">expired?</span><span
                                class="method-args">(connection)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns true if the connection should be reset due to an idle timeout, or maximum request count, false otherwise.</p>

                              <div class="method-source-code" id="expired-3F-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 642</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">expired?</span> <span class="ruby-identifier">connection</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span>  <span class="ruby-keyword">if</span>     <span class="ruby-ivar">@max_requests</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">requests</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-ivar">@max_requests</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@idle_timeout</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span>  <span class="ruby-keyword">if</span>     <span class="ruby-ivar">@idle_timeout</span>.<span class="ruby-identifier">zero?</span>

  <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">last_use</span> <span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@idle_timeout</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-finish" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">finish</span><span
                                class="method-args">(connection)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Finishes the Net::HTTP <code>connection</code></p>

                              <div class="method-source-code" id="finish-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 671</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">finish</span> <span class="ruby-identifier">connection</span>
  <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">finish</span>

  <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">http</span>.<span class="ruby-identifier">instance_variable_set</span> <span class="ruby-value">:@last_communicated</span>, <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">http</span>.<span class="ruby-identifier">instance_variable_set</span> <span class="ruby-value">:@ssl_session</span>, <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span>
    <span class="ruby-ivar">@reuse_ssl_sessions</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-http_version" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">http_version</span><span
                                class="method-args">(uri)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the HTTP protocol version for <code>uri</code></p>

                              <div class="method-source-code" id="http_version-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 682</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">http_version</span> <span class="ruby-identifier">uri</span>
  <span class="ruby-ivar">@http_versions</span>[<span class="ruby-node">&quot;#{uri.hostname}:#{uri.port}&quot;</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-key-3D" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">key=</span><span
                                class="method-args">(key)</span>
                            </div>

                            <div class="method-description">
                              <p>For Net::HTTP parity</p>

                            </div>


                            <div class="aliases">
                              Alias for: <a href="Persistent.html#method-i-private_key-3D">private_key=</a>
                            </div>
                          </div>

                  <div id="method-i-max_retries-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">max_retries=</span><span
                                class="method-args">(retries)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Set the maximum number of retries for a request.</p>

<p>Defaults to one retry.</p>

<p>Set this to 0 to disable retries.</p>

                              <div class="method-source-code" id="max_retries-3D-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 700</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">max_retries=</span> <span class="ruby-identifier">retries</span>
  <span class="ruby-identifier">retries</span> = <span class="ruby-identifier">retries</span>.<span class="ruby-identifier">to_int</span>

  <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-string">&quot;max_retries must be positive&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">retries</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>

  <span class="ruby-ivar">@max_retries</span> = <span class="ruby-identifier">retries</span>

  <span class="ruby-identifier">reconnect</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-max_version-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">max_version=</span><span
                                class="method-args">(max_version)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>maximum SSL version to use</p>

                              <div class="method-source-code" id="max_version-3D-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 1033</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">max_version=</span> <span class="ruby-identifier">max_version</span>
  <span class="ruby-ivar">@max_version</span> = <span class="ruby-identifier">max_version</span>

  <span class="ruby-identifier">reconnect_ssl</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-min_version-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">min_version=</span><span
                                class="method-args">(min_version)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Minimum SSL version to use</p>

                              <div class="method-source-code" id="min_version-3D-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 1024</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">min_version=</span> <span class="ruby-identifier">min_version</span>
  <span class="ruby-ivar">@min_version</span> = <span class="ruby-identifier">min_version</span>

  <span class="ruby-identifier">reconnect_ssl</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-normalize_uri" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">normalize_uri</span><span
                                class="method-args">(uri)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Adds “http://” to the String <code>uri</code> if it is missing.</p>

                              <div class="method-source-code" id="normalize_uri-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 689</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">normalize_uri</span> <span class="ruby-identifier">uri</span>
  (<span class="ruby-identifier">uri</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^https?:/</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">uri</span> <span class="ruby-operator">:</span> <span class="ruby-node">&quot;http://#{uri}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-private_key-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">private_key=</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Sets this client’s SSL private key</p>

                              <div class="method-source-code" id="private_key-3D-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 713</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">private_key=</span> <span class="ruby-identifier">key</span>
  <span class="ruby-ivar">@private_key</span> = <span class="ruby-identifier">key</span>

  <span class="ruby-identifier">reconnect_ssl</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="Persistent.html#method-i-key-3D">key=</a>
                            </div>

                          </div>

                  <div id="method-i-proxy-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">proxy=</span><span
                                class="method-args">(proxy)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Sets the proxy server.  The <code>proxy</code> may be the <a href="../../../URI.html"><code>Bundler::URI</code></a> of the proxy server, the symbol <code>:ENV</code> which will read the proxy from the environment or nil to disable use of a proxy.  See <a href="Persistent.html#method-i-proxy_from_env"><code>proxy_from_env</code></a> for details on setting the proxy from the environment.</p>

<p>If the proxy <a href="../../../URI.html"><code>Bundler::URI</code></a> is set after requests have been made, the next request will shut-down and re-open all connections.</p>

<p>The <code>no_proxy</code> query parameter can be used to specify hosts which shouldn’t be reached via proxy; if set it should be a comma separated list of hostname suffixes, optionally with <code>:port</code> appended, for example <code>example.com,some.host:8080</code>.</p>

                              <div class="method-source-code" id="proxy-3D-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 736</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">proxy=</span> <span class="ruby-identifier">proxy</span>
  <span class="ruby-ivar">@proxy_uri</span> = <span class="ruby-keyword">case</span> <span class="ruby-identifier">proxy</span>
               <span class="ruby-keyword">when</span> <span class="ruby-value">:ENV</span>      <span class="ruby-keyword">then</span> <span class="ruby-identifier">proxy_from_env</span>
               <span class="ruby-keyword">when</span> <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">proxy</span>
               <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>       <span class="ruby-keyword">then</span> <span class="ruby-comment"># ignore</span>
               <span class="ruby-keyword">else</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-string">&#39;proxy must be :ENV or a Bundler::URI::HTTP&#39;</span>
               <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@no_proxy</span>.<span class="ruby-identifier">clear</span>

  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@proxy_uri</span> <span class="ruby-keyword">then</span>
    <span class="ruby-ivar">@proxy_args</span> = [
      <span class="ruby-ivar">@proxy_uri</span>.<span class="ruby-identifier">hostname</span>,
      <span class="ruby-ivar">@proxy_uri</span>.<span class="ruby-identifier">port</span>,
      <span class="ruby-identifier">unescape</span>(<span class="ruby-ivar">@proxy_uri</span>.<span class="ruby-identifier">user</span>),
      <span class="ruby-identifier">unescape</span>(<span class="ruby-ivar">@proxy_uri</span>.<span class="ruby-identifier">password</span>),
    ]

    <span class="ruby-ivar">@proxy_connection_id</span> = [<span class="ruby-keyword">nil</span>, <span class="ruby-operator">*</span><span class="ruby-ivar">@proxy_args</span>].<span class="ruby-identifier">join</span> <span class="ruby-string">&#39;:&#39;</span>

    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@proxy_uri</span>.<span class="ruby-identifier">query</span> <span class="ruby-keyword">then</span>
      <span class="ruby-ivar">@no_proxy</span> = <span class="ruby-constant">CGI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-ivar">@proxy_uri</span>.<span class="ruby-identifier">query</span>)[<span class="ruby-string">&#39;no_proxy&#39;</span>].<span class="ruby-identifier">join</span>(<span class="ruby-string">&#39;,&#39;</span>).<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&#39;,&#39;</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">strip</span> }.<span class="ruby-identifier">reject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">empty?</span> }
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">reconnect</span>
  <span class="ruby-identifier">reconnect_ssl</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-proxy_bypass-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">proxy_bypass?</span><span
                                class="method-args">(host, port)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns true when proxy should by bypassed for host.</p>

                              <div class="method-source-code" id="proxy_bypass-3F-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 810</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">proxy_bypass?</span> <span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>
  <span class="ruby-identifier">host</span> = <span class="ruby-identifier">host</span>.<span class="ruby-identifier">downcase</span>
  <span class="ruby-identifier">host_port</span> = [<span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>].<span class="ruby-identifier">join</span> <span class="ruby-string">&#39;:&#39;</span>

  <span class="ruby-ivar">@no_proxy</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">host</span>[<span class="ruby-operator">-</span><span class="ruby-identifier">name</span>.<span class="ruby-identifier">length</span>, <span class="ruby-identifier">name</span>.<span class="ruby-identifier">length</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">name</span> <span class="ruby-keyword">or</span>
       <span class="ruby-identifier">host_port</span>[<span class="ruby-operator">-</span><span class="ruby-identifier">name</span>.<span class="ruby-identifier">length</span>, <span class="ruby-identifier">name</span>.<span class="ruby-identifier">length</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">name</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-proxy_from_env" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">proxy_from_env</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Creates a <a href="../../../URI.html"><code>Bundler::URI</code></a> for an HTTP proxy server from ENV variables.</p>

<p>If <code>HTTP_PROXY</code> is set a proxy will be returned.</p>

<p>If <code>HTTP_PROXY_USER</code> or <code>HTTP_PROXY_PASS</code> are set the <a href="../../../URI.html"><code>Bundler::URI</code></a> is given the indicated user and password unless HTTP_PROXY contains either of these in the <a href="../../../URI.html"><code>Bundler::URI</code></a>.</p>

<p>The <code>NO_PROXY</code> ENV variable can be used to specify hosts which shouldn’t be reached via proxy; if set it should be a comma separated list of hostname suffixes, optionally with <code>:port</code> appended, for example <code>example.com,some.host:8080</code>. When set to <code>*</code> no proxy will be returned.</p>

<p>For Windows users, lowercase ENV variables are preferred over uppercase ENV variables.</p>

                              <div class="method-source-code" id="proxy_from_env-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 783</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">proxy_from_env</span>
  <span class="ruby-identifier">env_proxy</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;http_proxy&#39;</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;HTTP_PROXY&#39;</span>]

  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">env_proxy</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">env_proxy</span>.<span class="ruby-identifier">empty?</span>

  <span class="ruby-identifier">uri</span> = <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span> <span class="ruby-identifier">normalize_uri</span> <span class="ruby-identifier">env_proxy</span>

  <span class="ruby-identifier">env_no_proxy</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;no_proxy&#39;</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;NO_PROXY&#39;</span>]

  <span class="ruby-comment"># &#39;*&#39; is special case for always bypass</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">env_no_proxy</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;*&#39;</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">env_no_proxy</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">query</span> = <span class="ruby-node">&quot;no_proxy=#{escape(env_no_proxy)}&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">user</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">password</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">user</span>     = <span class="ruby-identifier">escape</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;http_proxy_user&#39;</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;HTTP_PROXY_USER&#39;</span>]
    <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">password</span> = <span class="ruby-identifier">escape</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;http_proxy_pass&#39;</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;HTTP_PROXY_PASS&#39;</span>]
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">uri</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-reconnect" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">reconnect</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Forces reconnection of all HTTP connections, including TLS/SSL connections.</p>

                              <div class="method-source-code" id="reconnect-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 826</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reconnect</span>
  <span class="ruby-ivar">@generation</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-reconnect_ssl" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">reconnect_ssl</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Forces reconnection of only TLS/SSL connections.</p>

                              <div class="method-source-code" id="reconnect_ssl-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 833</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reconnect_ssl</span>
  <span class="ruby-ivar">@ssl_generation</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-request" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">request</span><span
                                class="method-args">(uri, req = nil, &amp;block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Makes a request on <code>uri</code>.  If <code>req</code> is nil a Net::HTTP::Get is performed against <code>uri</code>.</p>

<p>If a block is passed <a href="Persistent.html#method-i-request"><code>request</code></a> behaves like Net::HTTP#request (the body of the response will not have been read).</p>

<p><code>req</code> must be a Net::HTTPGenericRequest subclass (see Net::HTTP for a list).</p>

                              <div class="method-source-code" id="request-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 865</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">request</span> <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">req</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>
  <span class="ruby-identifier">uri</span>      = <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span> <span class="ruby-identifier">uri</span>
  <span class="ruby-identifier">req</span>      = <span class="ruby-identifier">request_setup</span> <span class="ruby-identifier">req</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">uri</span>
  <span class="ruby-identifier">response</span> = <span class="ruby-keyword">nil</span>

  <span class="ruby-identifier">connection_for</span> <span class="ruby-identifier">uri</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">connection</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">http</span> = <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">http</span>

    <span class="ruby-keyword">begin</span>
      <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">requests</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>

      <span class="ruby-identifier">response</span> = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span> <span class="ruby-identifier">req</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>

      <span class="ruby-keyword">if</span> <span class="ruby-identifier">req</span>.<span class="ruby-identifier">connection_close?</span> <span class="ruby-keyword">or</span>
        (<span class="ruby-identifier">response</span>.<span class="ruby-identifier">http_version</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-string">&#39;1.0&#39;</span> <span class="ruby-keyword">and</span>
          <span class="ruby-keyword">not</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">connection_keep_alive?</span>) <span class="ruby-keyword">or</span>
          <span class="ruby-identifier">response</span>.<span class="ruby-identifier">connection_close?</span> <span class="ruby-keyword">then</span>
        <span class="ruby-identifier">finish</span> <span class="ruby-identifier">connection</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> <span class="ruby-comment"># make sure to close the connection when it was interrupted</span>
      <span class="ruby-identifier">finish</span> <span class="ruby-identifier">connection</span>

      <span class="ruby-identifier">raise</span>
    <span class="ruby-keyword">ensure</span>
      <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">last_use</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@http_versions</span>[<span class="ruby-node">&quot;#{uri.hostname}:#{uri.port}&quot;</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">http_version</span>

  <span class="ruby-identifier">response</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-reset" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">reset</span><span
                                class="method-args">(connection)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Finishes then restarts the Net::HTTP <code>connection</code></p>

                              <div class="method-source-code" id="reset-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 840</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reset</span> <span class="ruby-identifier">connection</span>
  <span class="ruby-identifier">http</span> = <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">http</span>

  <span class="ruby-identifier">finish</span> <span class="ruby-identifier">connection</span>

  <span class="ruby-identifier">start</span> <span class="ruby-identifier">http</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNREFUSED</span>
  <span class="ruby-identifier">e</span> = <span class="ruby-constant">Error</span>.<span class="ruby-identifier">new</span> <span class="ruby-node">&quot;connection refused: #{http.address}:#{http.port}&quot;</span>
  <span class="ruby-identifier">e</span>.<span class="ruby-identifier">set_backtrace</span> <span class="ruby-identifier">$@</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EHOSTDOWN</span>
  <span class="ruby-identifier">e</span> = <span class="ruby-constant">Error</span>.<span class="ruby-identifier">new</span> <span class="ruby-node">&quot;host down: #{http.address}:#{http.port}&quot;</span>
  <span class="ruby-identifier">e</span>.<span class="ruby-identifier">set_backtrace</span> <span class="ruby-identifier">$@</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-shutdown" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">shutdown</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Shuts down all connections</p>

<p><strong>NOTE</strong>: Calling shutdown for can be dangerous!</p>

<p>If any thread is still using a connection it may cause an error!  Call <a href="Persistent.html#method-i-shutdown"><code>shutdown</code></a> when you are completely done making requests!</p>

                              <div class="method-source-code" id="shutdown-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 935</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">shutdown</span>
  <span class="ruby-ivar">@pool</span>.<span class="ruby-identifier">shutdown</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">http</span><span class="ruby-operator">|</span> <span class="ruby-identifier">http</span>.<span class="ruby-identifier">finish</span> }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ssl" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ssl</span><span
                                class="method-args">(connection)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Enables SSL on <code>connection</code></p>

                              <div class="method-source-code" id="ssl-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 942</span>
  <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ssl</span> <span class="ruby-identifier">connection</span>
    <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">use_ssl</span> = <span class="ruby-keyword">true</span>

    <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">ciphers</span>     = <span class="ruby-ivar">@ciphers</span>     <span class="ruby-keyword">if</span> <span class="ruby-ivar">@ciphers</span>
    <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">ssl_timeout</span> = <span class="ruby-ivar">@ssl_timeout</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@ssl_timeout</span>
    <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">ssl_version</span> = <span class="ruby-ivar">@ssl_version</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@ssl_version</span>
    <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">min_version</span> = <span class="ruby-ivar">@min_version</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@min_version</span>
    <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">max_version</span> = <span class="ruby-ivar">@max_version</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@max_version</span>

    <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">verify_depth</span> = <span class="ruby-ivar">@verify_depth</span>
    <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">verify_mode</span>  = <span class="ruby-ivar">@verify_mode</span>

    <span class="ruby-keyword">if</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSL</span><span class="ruby-operator">::</span><span class="ruby-constant">VERIFY_PEER</span> <span class="ruby-operator">==</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSL</span><span class="ruby-operator">::</span><span class="ruby-constant">VERIFY_NONE</span> <span class="ruby-keyword">and</span>
       <span class="ruby-keyword">not</span> <span class="ruby-constant">Object</span>.<span class="ruby-identifier">const_defined?</span>(<span class="ruby-value">:I_KNOW_THAT_OPENSSL_VERIFY_PEER_EQUALS_VERIFY_NONE_IS_WRONG</span>) <span class="ruby-keyword">then</span>
      <span class="ruby-identifier">warn</span> <span class="ruby-identifier">&lt;&lt;-WARNING</span>
<span class="ruby-value">                             !!!SECURITY WARNING!!!

The SSL HTTP connection to:

  #{connection.address}:#{connection.port}

                           !!!MAY NOT BE VERIFIED!!!

On your platform your OpenSSL implementation is broken.

There is no difference between the values of VERIFY_NONE and VERIFY_PEER.

This means that attempting to verify the security of SSL connections may not
work.  This exposes you to man-in-the-middle exploits, snooping on the
contents of your connection and other dangers to the security of your data.

To disable this warning define the following constant at top-level in your
application:

  I_KNOW_THAT_OPENSSL_VERIFY_PEER_EQUALS_VERIFY_NONE_IS_WRONG = nil

</span><span class="ruby-identifier">      WARNING</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">ca_file</span> = <span class="ruby-ivar">@ca_file</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@ca_file</span>
    <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">ca_path</span> = <span class="ruby-ivar">@ca_path</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@ca_path</span>

    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@ca_file</span> <span class="ruby-keyword">or</span> <span class="ruby-ivar">@ca_path</span> <span class="ruby-keyword">then</span>
      <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">verify_mode</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">SSL</span><span class="ruby-operator">::</span><span class="ruby-constant">VERIFY_PEER</span>
      <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">verify_callback</span> = <span class="ruby-ivar">@verify_callback</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@verify_callback</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@certificate</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@private_key</span> <span class="ruby-keyword">then</span>
      <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">cert</span> = <span class="ruby-ivar">@certificate</span>
      <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">key</span>  = <span class="ruby-ivar">@private_key</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">cert_store</span> = <span class="ruby-keyword">if</span> <span class="ruby-ivar">@cert_store</span> <span class="ruby-keyword">then</span>
                              <span class="ruby-ivar">@cert_store</span>
                            <span class="ruby-keyword">else</span>
                              <span class="ruby-identifier">store</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">Store</span>.<span class="ruby-identifier">new</span>
                              <span class="ruby-identifier">store</span>.<span class="ruby-identifier">set_default_paths</span>
                              <span class="ruby-identifier">store</span>
                            <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ssl_timeout-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ssl_timeout=</span><span
                                class="method-args">(ssl_timeout)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>SSL session lifetime</p>

                              <div class="method-source-code" id="ssl_timeout-3D-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 1006</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ssl_timeout=</span> <span class="ruby-identifier">ssl_timeout</span>
  <span class="ruby-ivar">@ssl_timeout</span> = <span class="ruby-identifier">ssl_timeout</span>

  <span class="ruby-identifier">reconnect_ssl</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ssl_version-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ssl_version=</span><span
                                class="method-args">(ssl_version)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>SSL version to use</p>

                              <div class="method-source-code" id="ssl_version-3D-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 1015</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ssl_version=</span> <span class="ruby-identifier">ssl_version</span>
  <span class="ruby-ivar">@ssl_version</span> = <span class="ruby-identifier">ssl_version</span>

  <span class="ruby-identifier">reconnect_ssl</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-start" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">start</span><span
                                class="method-args">(http)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Starts the Net::HTTP <code>connection</code></p>

                              <div class="method-source-code" id="start-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 653</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">start</span> <span class="ruby-identifier">http</span>
  <span class="ruby-identifier">http</span>.<span class="ruby-identifier">set_debug_output</span> <span class="ruby-ivar">@debug_output</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@debug_output</span>
  <span class="ruby-identifier">http</span>.<span class="ruby-identifier">open_timeout</span> = <span class="ruby-ivar">@open_timeout</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@open_timeout</span>

  <span class="ruby-identifier">http</span>.<span class="ruby-identifier">start</span>

  <span class="ruby-identifier">socket</span> = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">instance_variable_get</span> <span class="ruby-value">:@socket</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">socket</span> <span class="ruby-keyword">then</span> <span class="ruby-comment"># for fakeweb</span>
    <span class="ruby-ivar">@socket_options</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">option</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">socket</span>.<span class="ruby-identifier">io</span>.<span class="ruby-identifier">setsockopt</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">option</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-unescape" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">unescape</span><span
                                class="method-args">(str)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>CGI::unescape wrapper</p>

                              <div class="method-source-code" id="unescape-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 633</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">unescape</span> <span class="ruby-identifier">str</span>
  <span class="ruby-constant">CGI</span>.<span class="ruby-identifier">unescape</span> <span class="ruby-identifier">str</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">str</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-verify_callback-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">verify_callback=</span><span
                                class="method-args">(callback)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>SSL verification callback.</p>

                              <div class="method-source-code" id="verify_callback-3D-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 1064</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">verify_callback=</span> <span class="ruby-identifier">callback</span>
  <span class="ruby-ivar">@verify_callback</span> = <span class="ruby-identifier">callback</span>

  <span class="ruby-identifier">reconnect_ssl</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-verify_depth-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">verify_depth=</span><span
                                class="method-args">(verify_depth)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Sets the depth of SSL certificate verification</p>

                              <div class="method-source-code" id="verify_depth-3D-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 1042</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">verify_depth=</span> <span class="ruby-identifier">verify_depth</span>
  <span class="ruby-ivar">@verify_depth</span> = <span class="ruby-identifier">verify_depth</span>

  <span class="ruby-identifier">reconnect_ssl</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-verify_mode-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">verify_mode=</span><span
                                class="method-args">(verify_mode)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Sets the HTTPS verify mode.  Defaults to OpenSSL::SSL::VERIFY_PEER.</p>

<p>Setting this to VERIFY_NONE is a VERY BAD IDEA and should NEVER be used. Securely transfer the correct certificate and update the default certificate store or set the ca file instead.</p>

                              <div class="method-source-code" id="verify_mode-3D-source">
            <pre><span class="ruby-comment"># File bundler/vendor/net-http-persistent/lib/net/http/persistent.rb, line 1055</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">verify_mode=</span> <span class="ruby-identifier">verify_mode</span>
  <span class="ruby-ivar">@verify_mode</span> = <span class="ruby-identifier">verify_mode</span>

  <span class="ruby-identifier">reconnect_ssl</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is a service of <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>, purveyors of fine <a href='https://jamesbritt.bandcamp.com/'>dance noise</a></p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

